<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>规则集编辑</title>
    <link href="../../static/css/engine.css" rel="stylesheet">
    <script src="/bower_components/requirejs/require.js" data-main="/static/app.js"
            data-bootstrap-modules="'system/rule/RuleAssemblyModule'"></script>
</head>
<body ng-controller="RuleAssemblyController">
<div id="engine-container">
    <!--头部-->
    <div id="engine-header">
        <!--logo-->
        <div class="engine-logo">
            <img src="../../static/images/logo.png" style="vertical-align:bottom">
            <span class="system-name">规则引擎管理系统</span>
        </div>
        <!--logo结束-->
        <!--按钮组-->
        <ul class="engine-button-group">
            <li><button type="button" class="engine-btn-default"><i class="icon-engine-compile"></i>编译</button></li>
            <li><button type="button" class="engine-btn-default"><i class="icon-engine-test"></i>测试</button></li>
            <li><button type="button" class="engine-btn-default"><i class="icon-engine-release"></i>发布</button></li>
        </ul>
        <!--按钮组结束-->
        <!--用户设置-->
        <ul class="engine-header-r">
            <li><button type="button" class="engine-btn-default"><i class="icon-engine-monitor"></i>监控</button></li>
            <li class="user">
                <a href="#">
                    <span><img src="../../static/images/user.png" style="vertical-align:middle;"></span>
                    <span>zhoujl</span>
                    <span><i class="icon-engine-down-a"></i></span>
                </a>
            <li>
        </ul>
        <!--用户设置结束-->
        <div class="clear"></div>
    </div>
    <!--头部结束-->
    <!--内容-->
    <div id="engine-content">
        <!--左列-->
        <div class="sidebar-left">
            <!--项目浏览-->
            <div class="project-browse">
                <div class="project-browse-l">项目浏览</div>
                <div class="project-browse-r"><a href="#"><i class="icon-engine-set"></i></a></div>
                <div class="clear"></div>
            </div>
            <!--项目浏览结束-->
            <!--选择项目-->
            <div class="select-project">
                <div class="select-project-l">会员</div>
                <div class="select-project-r"><a href="#"><i class="icon-engine-down-b"></i></a></div>
                <div class="clear"></div>
            </div>
            <!--选择项目结束-->
            <!--会员积分-->
            <div class="select-project" style="height:65px;">
                <div class="select-project-top">
                    <div class="select-project-l">会员积分</div>
                    <div class="select-project-r"><a href="#"><i class="icon-engine-down-b"></i></a></div>
                    <div class="clear"></div>
                </div>
                <div class="select-project-bottom">
                    <a href="#"><img src="../../static/images/intersection.png"></a>
                    <a href="#"><img src="../../static/images/rule.png"></a>
                    <a href="#"><img src="../../static/images/tree.png"></a>
                    <a href="#"><img src="../../static/images/surface.png"></a>
                </div>
            </div>
            <!--会员积分结束-->
            <!--规则包配置标题-->
            <div class="project-title">规则包配置：</div>
            <!--规则包配置标题结束-->
            <!--菜单-->
            <ul class="engine-menu">
                <li class="menu-one"><a href="#"><i class="icon-engine-list"></i>积分规则集</a>
                    <ul>
                        <li><a href="#">会员购买总费用</a></li>
                        <li><a href="#">会员购买总笔数>10</a></li>
                        <li><a href="#">会员入会时间<2y</a></li>
                    </ul>
                </li>
                <li class="menu-one"><a href="#"><i class="icon-engine-list"></i>特殊商品积分规则集</a></li>
                <li class="menu-one"><a href="#"><i class="icon-engine-list"></i>换购规则集</a>
                    <ul>
                        <li><a href="#">换购商品</a></li>
                        <li><a href="#">换购条件</a></li>
                    </ul>
                </li>
                <li class="menu-one"><a href="#"><i class="icon-engine-list"></i>积分换购礼品决策表</a></li>
            </ul>
            <!--菜单结束-->
        </div>
        <!--左列结束-->
        <!--右列-->
        <div class="sidebar-right">
            <!--标题-->
            <div class="sidebar-right-title">
                <div class="sidebar-right-title-l">[规则集] 积分规则集</div>
                <div class="sidebar-right-title-r"><button type="button" class="engine-btn-success" ng-click="save()"><i class="icon-engine-preservation"></i>保存</button></div>
                <div class="clear"></div>
            </div>
            <!--标题结束-->
            <!--页签-->
            <div class="engine-tab">
                <ul>
                    <li class="on">进入条件</li>
                    <li><a href="#">规则集变量</a></li>
                    <li><a href="#">规则集设置</a></li>
                </ul>
            </div>
            <!--页签结束-->
            <!--详细内容-->
            <div class="engine-tab-content">
                <!--详细内容左列-->
                <div class="engine-tab-content-l">
                    <!--添加-->
                    <div class="add"><a href="#" ng-click="addRow()"><i class="icon-engine-plus"></i></a></div>
                    <div class="clear"></div>
                    <!--添加结束-->
                    <!--进入条件-->
                    <div class="entry" id="condition">
                        <div class="entry-title" >进入条件</div>

                    </div>
                    <!--进入条件-->
                </div>
                <!--详细内容左列结束-->
                <!--详细内容右列-->
                <div class="engine-tab-content-r">
                    <div ng-show="showNone">
                        <div class="remind-r">
                            <div class="tu"><i class="icon-engine-remind"></i></div>
                            <div class="text">请单击条件选择框进行编辑。</div>
                            <div class="clear"></div>
                        </div>
                    </div>
                    <div ng-show="showAllCondition">
                        <div class="engine-condition">
                            <ul>
                                <li class="on" name="column" id="property"><a href="#" ng-click="show('property')">模型</a></li>
                                <li name="column" id="entry"><a href="#" ng-click="show('entry')">输入值</a></li>
                                <li name="column" id="sign"><a href="#" ng-click="show('sign')">符号</a></li>
                                <li name="column" id="variable"><a href="#" ng-click="show('variable')">变量</a></li>
                                <li name="column" id="method"><a href="#" ng-click="show('method')">方法</a></li>
                            </ul>
                        </div>
                        <!--条件结束-->
                        <!--属性值-->
                        <div class="engine-attribute" ng-show="showProperty">
                            <!--业务模型-->
                            <div class="model">
                                <div class="model-l">业务模型</div>
                                <div class="model-r"><a href="#"><i class="icon-engine-search"></i></a></div>
                                <div class="clear"></div>
                            </div>
                            <div class="model-value">
                                <table width="100%">
                                    <tr ng-repeat="modelAttribute in modelAttributes">
                                        <td ng-if="modelAttribute.dataType!='Object'">
                                            <div class="model-value-l"><button type="button" class="engine-btn-model" ng-click="addModel(modelAttribute.name)">{{modelAttribute.dataType}}</button></div>
                                            <div class="model-value-r">{{modelAttribute.name}}</div>
                                            <div class="clear"></div>
                                        </td>
                                        <td ng-if="modelAttribute.dataType=='Object'">
                                            <div class="model-value-l"><button type="button" class="engine-btn-model" id="{{modelAttribute.id}}" ng-click="viewObject(modelAttribute.id,1)">对象[+]</button></div>
                                            <div class="model-value-r">{{modelAttribute.name}}</div>
                                            <div class="clear"></div>
                                            <div id="son{{modelAttribute.id}}" ></div>
                                        </td>
                                    </tr>
                                </table>
                            </div>

                        </div>

                        <div class="engine-attribute" ng-show="showEntry">
                            <!--输入值-->
                            <div class="value">
                                <div class="engine-form-group">
                                    <label>输入值</label>
                                    <textarea cols="47" rows="10" ng-model="textEntry"></textarea>
                                </div>
                                <button type="button" class="engine-btn-default" ng-click="addEntry()">确定</button>
                            </div>
                            <!--输入值结束-->
                        </div>

                        <div class="engine-attribute" ng-show="showMethod">
                            <!--输入值-->
                            <div class="model-value">
                                <div class="model-value-l"><button type="button" class="engine-btn-model" ng-click="addMethod('addHours')">确定</button></div>
                                <div class="model-value-r">加 &nbsp;<input type="text" id = "addHours" style="width: 20px"/>&nbsp; 小时</div>
                                <div class="clear"></div>
                            </div>
                            <div class="model-value">
                                <div class="model-value-l"><button type="button" class="engine-btn-model" ng-click="addMethod('lastDateTime','当天最后时间')">确定</button></div>
                                <div class="model-value-r">当天最后时间</div>
                                <div class="clear"></div>
                            </div>
                            <div class="model-value">
                                <div class="model-value-l"><button type="button" class="engine-btn-model" ng-click="addMethod('nowDate','当前时间')">确定</button></div>
                                <div class="model-value-r">当天开始时间</div>
                                <div class="clear"></div>
                            </div>
                            <!--输入值结束-->
                        </div>


                        <div class="engine-attribute" ng-show="showVariable">
                            <div class="model-value">
                                <table width="100%">
                                    <tr ng-repeat="variable in variables">
                                        <td>
                                            <div class="model-value-l"><button type="button" class="engine-btn-model" ng-click="addVariable(variable.varName)">变量</button></div>
                                            <div class="model-value-r">{{variable.varName}}</div>
                                            <div class="clear"></div>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </div>

                        <div class="engine-attribute" ng-show="showSign">
                            <!--符号-->
                            <div class="symbol">
                                <div class="symbol-tit">逻辑运算符</div>
                                <div class="symbol-but">
                                    <button type="button" ng-click="addSign('&&')"  class="engine-btn-symbol">并且</button>
                                    <button type="button" ng-click="addSign('||')" class="engine-btn-symbol">或者√</button>
                                </div>
                                <div class="symbol-tit">比较符</div>
                                <div class="symbol-but">
                                    <button type="button" ng-click="addSign('<')" class="engine-btn-symbol">小于</button>
                                    <button type="button" ng-click="addSign('==')" class="engine-btn-symbol">等于</button>
                                    <button type="button" ng-click="addSign('>')" class="engine-btn-symbol">大于</button>
                                    <button type="button" ng-click="addSign('<=')" class="engine-btn-symbol">小于等于</button>
                                    <button type="button" ng-click="addSign('!=')" class="engine-btn-symbol">不等于</button>
                                    <button type="button" ng-click="addSign('>=')" class="engine-btn-symbol">大于等于</button>
                                </div>
                                <div class="symbol-tit">数值运算符</div>
                                <div class="symbol-but">
                                    <button type="button"  ng-click="addSign('+')" class="engine-btn-symbol">+</button>
                                    <button type="button"  ng-click="addSign('-')"class="engine-btn-symbol">-</button>
                                    <button type="button" ng-click="addSign('*')" class="engine-btn-symbol">*</button>
                                    <button type="button"  ng-click="addSign('/')" class="engine-btn-symbol">/</button>
                                </div>
                                <div class="symbol-tit">数值运算符</div>
                                <div class="symbol-but">
                                    <button type="button" ng-click="addSign('(')" class="engine-btn-symbol">(</button>
                                    <button type="button" ng-click="addSign(')')" class="engine-btn-symbol">)</button>

                                </div>
                            </div>
                            <!--符号结束-->
                        </div>
                        <!--属性值结束-->
                        <div class="clear"></div>
                    </div>

                </div>
                <!--详细内容右列结束-->
                <div class="clear"></div>
            </div>
            <!--详细内容结束-->
        </div>
        <!--右列结束-->
    </div>
    <!--内容结束-->
</div>
</body>
</html>